import { Buff } from "../class/Effect";
import { Method } from "../class/Method";

/**
 * 治愈
 */
export class Cure extends Method {
    static methodName = "治愈"
    public CD: number = 30E3;
    public describe: string = "治疗自己，在 5S 时间里，总共回复 10%(MAXHP) 生命值";
    invoke() {
        this.masterRole.addEffectByClass(class extends Buff {
            public sumTime: number = 5E3;
            public eachTime: number = 1E3;
            public invoke(): void {
                const HP = Math.floor(this.masterRole.getMAXHP() * 0.1)
                this.masterRole.setHP(HP)
            }
        })
    }

}